<script setup>
const props = defineProps({
  name: String,
  age: Number,
})
console.log(props.name, props.age)

const emit = defineEmits(['changeCount'])

const handleClick = () => {
  emit('changeCount')
}

const test = () => {
  console.log(1)
}

const r = await fetch('https://autumnfish.cn/api/joke')
const text = await r.text()
console.log(text)

defineExpose({
  test,
})
</script>

<script>
console.log(1)
</script>

<template>
  <div>Foo: {{ name }} age: {{ props.age }}</div>
  <button @click="handleClick">修改 count</button>
</template>
